package com.bosssoft.hr.jobmonitor.tmp.entity;

import com.bosssoft.hr.jobmonitor.tmp.myEnum.ConfigConsts;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * 用户类
 */
@Data
public class User implements Serializable {

    private static final long serialVersionUID = 5460008211836657112L;

    //用户名
    private String userName;
    //年龄
    private Integer age;
    //性别1为男，0为女
    private Integer sex;
    //如果明确需求，建议使用枚举类型
    //爱好 使用数组型json字符串
    private ConfigConsts hobbyEnum;
    //是否在线 建议不要使用is,在使用功能框架时可能无法实现
    private Integer online;
    //简介
    private String desc;

    public User() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(userName, user.userName) &&
                Objects.equals(age, user.age) &&
                Objects.equals(sex, user.sex) &&
                hobbyEnum == user.hobbyEnum &&
                Objects.equals(online, user.online) &&
                Objects.equals(desc, user.desc);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userName, age, sex, hobbyEnum, online, desc);
    }

    public User(String userName, Integer age, Integer sex, ConfigConsts hobbyEnum, Integer online, String desc) {
        this.userName = userName;
        this.age = age;
        this.sex = sex;
        this.hobbyEnum = hobbyEnum;
        this.online = online;
        this.desc = desc;
    }
}
